Micron Document
🎖️GitЯра🎖️

Node / meshcore / MeshCore / files / src / helpers / ui / buzzer.h

Displaying Raw • Download

src/helpers/ui/buzzer.h 890a2e2cffa98dea3ca88db3c3aba72ef23ff3f7 (890a2e2c) Text, 1.07 KB

Tff7b72#Tff7b72pragma once

Tff7b72#Tff7b72include T8b949e<Arduino.h>
Tff7b72#Tff7b72include T8b949e<NonBlockingRtttl.h>

T8b949e/* class abstracts underlying RTTTL library

Just a simple implementation to start. At the moment use same
melody for message and discovery
Suggest enum type for different sounds
- on message
- on discovery

TODO
- make message ring tone configurable

*/

Te6edf3class Te6edf3genericBuzzer
Tb4b4b4{
Te6edf3publicTff7b72:
Tffa657void Te6edf3beginTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// set up buzzer port
Tffa657void Td2a8ffplayTb4b4b4(Tff7b72const Tffa657char Tff7b72*Te6edf3melodyTb4b4b4)Tb4b4b4; T8b949e// Generic play function
Tffa657void Td2a8ffloopTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// loop driven-nonblocking
Tffa657void Td2a8ffstartupTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// play startup sound
Tffa657void Td2a8ffshutdownTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// play shutdown sound
Tffa657bool Td2a8ffisPlayingTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// returns true if a sound is still playing else false
Tffa657void Td2a8ffquietTb4b4b4(Tffa657bool Te6edf3buzzer_stateTb4b4b4)Tb4b4b4; T8b949e// enables or disables the buzzer
Tffa657bool Td2a8ffisQuietTb4b4b4(Tb4b4b4)Tb4b4b4; T8b949e// get buzzer state on/off

Te6edf3privateTff7b72:
T8b949e// gemini's picks:
Tff7b72const Tffa657char Tff7b72*Te6edf3startup_song Tff7b72= Ta5d6ff"Ta5d6ffStartup:d=4,o=5,b=160:16c6,16e6,8g6Ta5d6ff"Tb4b4b4;
Tff7b72const Tffa657char Tff7b72*Te6edf3shutdown_song Tff7b72= Ta5d6ff"Ta5d6ffShutdown:d=4,o=5,b=100:8g5,16e5,16c5Ta5d6ff"Tb4b4b4;

Tffa657bool Te6edf3_is_quiet Tff7b72= Tffa657trueTb4b4b4;
Tb4b4b4}Tb4b4b4;

Served by rngit 1.5.2 - Generated in 0.06s